<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class TeachesOffice extends Model
{ 
    use SoftDeletes;
    
    protected $table="teaches_office";
    
    protected $primaryKey = 'id';
    
    protected $fillable = ['id','name','news_id','url','user_id','size','file_name','file_path','pdf_url','swf_url','type'];
    
    protected $dates = ['deleted_at'];
    
    /**
     * 与用户一对一关联
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
    */
    public function users()
    {
        return $this->hasOne('App\User','id','user_id');
    }
    
}
